package com.woniuxy.meal.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Autowired
    private MyInterceptor myInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(myInterceptor)
                .addPathPatterns("/**")//拦截地址
                .excludePathPatterns(
                        "/page/**",
                        "/js/**",
                        "/css/**",
                        "/user/login",
                        "/user/register",
                        "/swagger-resources/**",
                        "/webjars/**",
                        "/v2/**",
                        "/swagger-ui.html/**")
                .excludePathPatterns("/dietOrder/showUserOrder")
                .excludePathPatterns("/swagger-resources/**")
                .excludePathPatterns("/webjars/**")
                .excludePathPatterns("/v2/**")
                .excludePathPatterns("/swagger-ui.html/**")
                .excludePathPatterns("/storeInfo/search","/userCart/showCartByStoreId" ,"/commentInfo/search",
                    "/foodVariety/search","/storeInfo/Info","/storeInfo/categories","/foodVariety/searchByType"
                );



    }
}
